package com.bristua.barcode.common.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator on 2019/8/9.
 */
@Component
public class HandelRedisQueueUtil {
    @Autowired
    private RedisTemplate redisTemplate;

    public String getValueFromQueue(String key){
        return String.valueOf(redisTemplate.opsForList().rightPop(key));
    }

    public void setValueToQueue(String key,String value){
        redisTemplate.opsForList().leftPush(key,value);
    }

}
